#include <pcap.h>
#include <stdio.h>

int main()
{
  char errBuf[PCAP_ERRBUF_SIZE], * device;
	u_int32_t net_ip, net_mask;
  char error_content[PCAP_ERRBUF_SIZE];
while(device = pcap_lookupdev(errBuf)){
  
  if(device)
  {
    printf("success: device: %s\n", device);
	pcap_lookupnet(device ,&net_ip,&net_mask,error_content);
	printf("ip:%d\n mask:%d\n", net_ip, net_mask);
  }
  else
  {
    printf("error: %s\n", errBuf);
  }
}
  return 0;
}
